# Field valid index constants
int16 VOLTAGE_BIT=0
int16 CURRENT_BIT=1
int16 NUMERIC_BAT_BIT=2
int16 TEMPERATURE_BIT=3
int16 CYCLE_COUNTS_BIT=4
int16 HEALTH_BIT=5
int16 BMS_STATE_BIT=6
int16 ERROR_CODE_BIT=7
int16 TOTAL_CHARGE_AH_BIT=8
int16 TOTAL_CHARGE_HOUR_BIT=9
int16 TOTAL_RUN_HOUR_BIT=10
int16 NOMINAL_CAPACITY_BIT=11

# Status flags
bool charge_flag
bool charge_finished
bool charge_interrupted

# Bitmask indicating valid fields (use constants above)
uint32 field_valid

# Battery data fields
float32 voltage             # Battery voltage (V)
float32 current             # Battery current (A)  
uint16 numeric_bat          # Battery state of charge (%)  
float32 temperature         # Battery temperature (°C)
uint16 cycle_counts         # Cycle counts
float32 health              # State of health (%)
uint16 bms_state            # BMS state 
uint16 error_code           # Error code    
float32 total_charge_ah     # Total charged ampere-hours (Ah)
float32 total_charge_hour   # Total charging time (hours)
float32 total_run_hour      # Total running time (hours)
float32 nominal_capacity    # Nominal capacity (Ah)
string cell_type            # Cell type (e.g., "Li-Ion", "LiFePO4")